<template>
    <h1>{{ msg }}</h1>

    <p>
        <a href="https://vitejs.dev/guide/features.html" target="_blank">Vite Documentation</a> |
        <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
    </p>

    <button @click="state.count++">count is: {{ state.count }}</button>
    <p>Edit<code>components/HelloWorld.vue</code> to test hot module replacement.</p>
    <el-button @click="emit('update:msg', child)">Emit</el-button>
    <el-button @click="geturl">axios</el-button>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
    <el-input placeholder="请输出"></el-input>
</template>

<script setup>
import { defineProps, reactive, defineEmit, ref } from 'vue'
import request from 'utils/axios.js'

defineProps({
    msg: String,
})
const child = ref('children value!!!!')
const emit = defineEmit(['update:msg'])

const state = reactive({ count: 0 })
const randomNember = () => {
    return Math.random()
}
const geturl = async () => {
    const res = await request.get('/user')
    console.log(res)
}

// fetch('/api/user')
//     .then((res) => res.json())
//     .then((data) => {
//         console.log(data)
//     })
</script>

<style scoped>
a {
    color: #42b983;
}
</style>
